package uztest;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ui.tempdao.EgnMarketVariDao;
import util.*;
import dao.*;

public class TestMarketVariable {
	private final static Logger logger =
		LoggerFactory.getLogger(TestMarketVariable.class);

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		aaa();
		bbb();
		ccc();
		ddd();

	}

	private static void aaa(){
		List<String> rst ;
		Session s = HibernateUtil.currentSession();

		logger.debug("Get EgnMarketVari Types");
		Query qr = s.createQuery("select distinct a.mvType from EgnMarketVari a" );

		try {
			rst = qr.list();
			for(String aa: rst){
				logger.debug("Mv Type :{}", aa);
			}
		} catch (RuntimeException re) {
			logger.error("failed", re);
			throw re;
		}
	}
	private static void bbb(){
		List<String> rst ;
		rst =EgnMarketVariDao.getEgnMarketVariTypes();

		for(String aa: rst){
			logger.debug("Mv Type 2 :{}", aa);
		}
	}
	private static void ccc(){
		List<EgnMarketVari> rst ;
		rst =EgnMarketVariDao.getAllEgnMarketVari();

		for(EgnMarketVari aa: rst){
			logger.debug("Mv Type 3 :{}", aa.getMvId());
		}
	}
	private static void ddd(){
		List<EgnMarketVari> rst ;
		rst =EgnMarketVariDao.getTypedEgnMarketVari("IR");
		for(EgnMarketVari aa: rst){
			logger.debug("Mv Type 4 :{}", aa.getMvId());
		}
	}
}
